// 课程章节相关接口文件

import request from "@/utils/request";

// 获取课程下章节列表
export function QueryChapterByCourse(data) {
  return request({
    url: "/course/admin/course/chapter/list",
    method: "post",
    data,
  });
}

// 修改章节信息
export function EditChapter(data) {
  return request({
    url: "/course/admin/course/chapter/edit",
    method: "put",
    data,
  });
}

// 新增章节信息
export function AddChapter(data) {
  return request({
    url: "/course/admin/course/chapter/save",
    method: "post",
    data,
  });
}

// 删除章节信息
export function DeleteChapter(id) {
  return request({
    url: `/course/admin/course/chapter/delete?id=${id}`,
    method: "delete",
  });
}

// 保存章节素材
export function SaveChapterMaterial(data) {
  return request({
    url: "/course/admin/course/chapter/period/save",
    method: "post",
    data,
  });
}

// 获取章节素材列表
export function QueryChapterMaterialByCourseId(data) {
  return request({
    url: "/course/admin/course/chapter/period/list",
    method: "post",
    data,
  });
}

// 删除章节素材
export function DeleteChapterMaterial(id) {
  return request({
    url: `/course/admin/course/chapter/period/delete?id=${id}`,
    method: "delete",
  });
}

// 编辑章节素材
export function EditChapterMaterial(data) {
  return request({
    url: `/course/admin/course/chapter/period/edit`,
    method: "put",
    data,
  });
}
